<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script src="./node_modules/vue/dist/vue.js"></script>
    <script>
      //   这个空的vue实例对象就可以被认为是一个事件总线
      const eventBus = new Vue();
      eventBus.$on("my-event", () => {
        console.log(123);
      });
      eventBus.$on("my-event1", () => {
        console.log(4561);
      });
      eventBus.$on("my-event1", () => {
        console.log(4562);
      });
      eventBus.$on("my-event2", () => {
        console.log(789);
      });
    </script>
  </body>
</html>
